require(['jquery','underscore','api'], function ($,_,api) {
  _.templateSettings = _templateSettings;

  var designerId = GetRequest().id,
    detailUrl = api.baseUrl+api.designer.detail,
    casesUrl = api.baseUrl+api.designer.cases,
    recommendsUrl = api.baseUrl+api.designer.recommends;

  $.get(detailUrl,{id: designerId}, function (res) {
    var data = res.data;
    $(".nav .designer-name").html(data.name);
    $('.designer-base-info').append(_.template($('#designer-base-tpl').html())({data: data}));
  });

  $.get(casesUrl,{id: designerId,caseType: 'YEAR_BEST_DESIGN',ps:3,pn:1}, function (res) {
    var data = res.data;
    $('.case-best-list').append(_.template($('#case-item-tpl').html())({data: data}));
  });

  $.get(casesUrl,{id: designerId,caseType: 'OPTIMAL_CASE'}, function (res) {
    var data = res.data;
    $('.case-like-list').append(_.template($('#case-item-tpl').html())({data: data}));
  });

  $.get(recommendsUrl,{num: 4,designerId: designerId}, function (res) {
    var data = res.data;
    $('.relate-designer .row').append(_.template($('#relate-designer-item').html())({data: data}));
  });
});